<?php
require_once('checklogin.php');
require_once('classQuanTriTin.php');
$qt = new quantritin;
$idYahoo=-1; if (isset($_GET['idYahoo'])==true) $idYahoo = $_GET['idYahoo']; settype($idYahoo,"int");
$yahoo = $qt->ListYahoo($idYahoo, -1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Yahoo Online</title>
<style>

    .hang_le {
	background-color: #72F722;
    }
    .hang_chan {
	background-color: #969696;
    }
-->
</style>
<script type="text/javascript" src="../Scripts/jquery.js"></script>
<script>
$(document).ready(function(){
	$("img.anhien").click(function(){
		idYahoo=$(this).attr("value");
		obj = this;
		$.ajax({
		   url:'yahoo_anhien.php',
		   data: 'idYahoo='+ idYahoo,
		   cache: false,
		   success: function(data){ //Biến data khai báo tên khác cũng được, dùng để nhận dữ liệu đổ về
			obj.src = data;
			if (data=="yahoo_1.gif") obj.title="Nhắp vào để offline";
			else obj.title="Nhắp vào để online";
		  }
		});
	});
	
});
</script>


</head>

<body>
<form id="form1" name="form1" method="post" action="">
<table  width=25% height="111"  border=0  align=left cellpadding=4  cellspacing=0 id=dstheloai>
<tr>
  <td colspan="3" align="left"></td>
</tr>
<tr id="tieude">
   <th><div align="center">Status Yahoo</div></th>
   
</tr>

<!—bắt đầu lặp -->
<?php 
while ($row_yahoo = mysql_fetch_assoc($yahoo)) { ?>
<?php ob_start(); ?>

<tr class="row">
   <td width="262" align="center" class="action"><img src="yahoo_{AnHien}.gif" alt="" class="anhien" title="Status Yahoo" value="{idYahoo}" /></td>
   </tr>
<?php 	
$str=ob_get_clean(); 
$str=str_replace("{idYahoo}", $row_yahoo['idYahoo'] , $str);
$str=str_replace("{AnHien}", $row_yahoo['AnHien'] , $str);

if($row_yahoo['AnHien']==1) $status = "VietnamFoodStep Online";
else $status = "VietnamFoodStep Offline";
$str=str_replace("{Status}", $status , $str);

echo $str;
?>
<?php } ?>

<!— kết thúc lặp -->
</table>
</form>
</body>
</html>
